<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
            <tr th:if="${isFree} == 1">
                <th class="text-center"><div class="table-first-id">ID</div></th>
                <th class="text-center" width="22%">问题</th>
                <th class="text-center" width="8%">分类</th>
                <th class="text-center" width="7%">提问人</th>
                <th class="text-center" width="9%">提问时间</th>
                <th class="text-center" width="7%">被问讲师</th>
                <th class="text-center" width="6%">回答者</th>
                <th class="text-center" width="6%" data-container="body" data-html="true" data-toggle="popover" data-trigger="hover" data-placement="top" data-content="被问者身份为前台问答专家讲师，而真实回答者在后台可能以管理员运营身份回答" data-original-title="" title="">被问/回答 <i class="fa fa-exclamation-circle" style="font-size:12px;font-weight: normal"></i></th>
                <th class="text-center" width="6%">点赞量</th>
                <th class="text-center" width="6%">回答量</th>
                <th class="text-center" width="6%">回答状态</th>
                <th class="text-center" width="6%">问题状态</th>
                <th class="text-center" width="6%">操作</th>
            </tr>
            <tr th:if="${isFree} == 2">
                <th class="text-center"><div class="table-first-id">ID</div></th>
                <th class="text-center" width="17%">问题</th>
                <th class="text-center" width="7%">分类</th>
                <th class="text-center" width="7%">提问人</th>
                <th class="text-center" width="9%">提问时间</th>
                <th class="text-center" width="6%">被问讲师</th>
                <th class="text-center" width="6%">回答者</th>
                <th class="text-center" width="6%"  data-container="body" data-html="true" data-toggle="popover" data-trigger="hover" data-placement="top" data-content="被问者身份为前台问答专家讲师，而真实回答者在后台可能以管理员运营身份回答" data-original-title="" title="">被问/回答 <i class="fa fa-exclamation-circle" style="font-size:12px;font-weight: normal"></i></th>
                <th class="text-center" width="5%">问题价格</th>
                <th class="text-center" width="5%">旁听人数</th>
                <th class="text-center" width="5%">点赞量</th>
                <th class="text-center" width="5%">评论量</th>
                <th class="text-center" width="5%">回答状态</th>
                <th class="text-center" width="5%">问题状态</th>
                <th class="text-center" width="6%">操作</th>
            </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody th:if="${isFree} == 1">
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center"><div class="table-first-id">&nbsp;</div></th>
                    <th class="text-center" width="23%"></th>
                    <th class="text-center" width="8%"></th>
                    <th class="text-center" width="7%"></th>
                    <th class="text-center" width="9%"></th>
                    <th class="text-center" width="7%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="6%"></th>
                </tr>
                <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="15" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="question : ${dataMap['list']}" th:attr="data-id=${question['id']}">
                    <td class="text-center">
                        <div class="table-first-id">
                            <input type="checkbox" th:value="${question['id']}" th:text="${question['id']}" class="i-checks" name="questionId"/>
                        </div>
                    </td>
                    <td class="text-center" th:text="${#strings.abbreviate(question['context'],50)}"></td>
                    <td class="text-center" th:text="${question['qaType']['typeName']}"></td>
                    <td class="text-center" th:text="${question['user']!=null&&question['user']['nickname']!=null?question['user']['nickname']:''}"></td>
                    <td class="text-center" th:text="${#strings.substring(question['createTime'], 0, 16)}"></td>
                    <td class="text-center" th:text="!${#maps.isEmpty(question['teacherMap'])} ? ${question['teacherMap']['teacherName']} : '—'">被问人</td>
                    <td class="text-center" th:if="${question['replyUser']}==null">-</td>
                    <td class="text-center" th:if="${question['replyUser']}!=null" th:text="${question['replyUser']['ralName']}">-</td>
                    <td class="text-center" th:if="${question['replyUser']}!=null" th:text="(${question['replyUser']['teacherId']} ==  ${question['teacherId']} and ${question['teacherId']}!=0 )?'是':'否'" ></td>
                    <td class="text-center" th:if="${question['replyUser']}==null">-</td>
                    <td class="text-center" th:text="${question['thumbNum']}"></td>
                    <td class="text-center" th:text="${question['replyNum']}"></td>
                    <td class="text-center">
                        <span th:if="${question['completeStatus']}==1">未完成</span>
                        <span th:if="${question['completeStatus']}==2">已完成</span>
                    </td>
                    <td class="text-center" questionStatus>
                        <span th:if="${question['status']}==1" class="label label-info">正常</span>
                        <span th:if="${question['status']}==2" class="label label-danger">禁用</span>
                    </td>
                    <td class="text-center" data-icon>
                        <a th:href="@{/admin/qa/question/freeQuestionInfo?questionId={questionId}(questionId = ${question['id']})}" class="c-master fs14" th:attr="data-id=${question['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="查看">
                            <i class="fa fa-eye"></i>
                        </a>
                        <a th:if="${question['status']} == 1" questionStatus href="javascript:void(0);" class="c-master fs14 ml5" th:attr="data-id=${question['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="禁用">
                            <i class="fa fa-unlock-alt"></i>
                        </a>
                        <a th:if="${question['status']}==2" questionStatus href="javascript:void(0);" class="c-master fs14 ml5" th:attr="data-id=${question['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复">
                            <i class="fa fa-history"></i>
                        </a>
                        <a th:attr="data-id=${question['id']}" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="删除">
                            <i class="fa fa-trash-o"></i>
                        </a>
                    </td>
                </tr>
            </tbody>
            <tbody th:if="${isFree} == 2">
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center"><div class="table-first-id">&nbsp;</div></th>
                    <th class="text-center" width="18%"></th>
                    <th class="text-center" width="7%"></th>
                    <th class="text-center" width="7%"></th>
                    <th class="text-center" width="9%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="6%"></th>
                </tr>
                <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="13" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="question : ${dataMap['list']}" th:attr="data-id=${question['id']}">
                    <td class="text-center">
                        <div class="table-first-id">
                            <input type="checkbox" th:value="${question['id']}" th:text="${question['id']}" class="i-checks" name="questionId"/>
                        </div>
                    </td>
                    <td class="text-center" th:text="${#strings.abbreviate(question['context'],50)}"></td>
                    <td class="text-center" th:text="${question['qaType']['typeName']}"></td>
                    <td class="text-center" th:text="${question['user']!=null&&question['user']['nickname']!=null?question['user']['nickname']:''}"></td>
                    <td class="text-center" th:text="${#strings.substring(question['createTime'], 0, 16)}"></td>
                    <td class="text-center" th:text="!${#maps.isEmpty(question['teacherMap'])} ? ${question['teacherMap']['teacherName']} : '—'">被问人</td>
                    <td class="text-center" th:if="${question['replyUser']}==null">-</td>
                    <td class="text-center" th:if="${question['replyUser']}!=null" th:text="${question['replyUser']['ralName']}">-</td>
                    <td class="text-center" th:if="${question['replyUser']}!=null" th:text="(${question['replyUser']['teacherId']} ==  ${question['teacherId']})?'是':'否'" ></td>
                    <td class="text-center" th:if="${question['replyUser']}==null">-</td>
                    <td class="text-center" th:text="${question['price']}"></td>
                    <td class="text-center" th:text="${question['attendNum']}"></td>
                    <td class="text-center" th:text="${question['thumbNum']}"></td>
                    <td class="text-center" th:text="${question['replyNum']}"></td>
                    <td class="text-center">
                        <span th:if="${question['completeStatus']}==1">未完成</span>
                        <span th:if="${question['completeStatus']}==2">已完成</span>
                        <span th:if="${question['completeStatus']}==3">已退费</span>
                    </td>
                    <td class="text-center" questionStatus>
                        <span th:if="${question['status']}==1" class="label label-info">正常</span>
                        <span th:if="${question['status']}==2" class="label label-danger">禁用</span>
                    </td>
                    <td class="text-center" data-icon>
                        <a th:href="@{/admin/qa/question/noFreeQuestionInfo?questionId={questionId}(questionId = ${question['id']})}" class="c-master fs14" th:attr="data-id=${question['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="查看">
                            <i class="fa fa-eye"></i>
                        </a>
                        <a th:if="${question['status']} == 1" questionStatus href="javascript:void(0);" class="c-master fs14 ml5" th:attr="data-id=${question['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="禁用">
                            <i class="fa fa-unlock-alt"></i>
                        </a>
                        <a th:if="${question['status']}==2" questionStatus href="javascript:void(0);" class="c-master fs14 ml5" th:attr="data-id=${question['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复">
                            <i class="fa fa-history"></i>
                        </a>
                        <a th:attr="data-id=${question['id']}" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="删除">
                            <i class="fa fa-trash-o"></i>
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>
</html>